<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->string('so_title', 55)->default('')->comment('标题');
            $table->string('so_description')->default('')->comment('描述');
            $table->text('so_content')->nullable()->comment('内容');;
            // 0初始，1审核中，2审核有效，3审核无效，4软删除。
            $table->tinyInteger('so_status')->default(0)->comment('状态');
            $table->integer('create_admin_id')->default(0)->comment('创建者id');
            $table->timestamp('created_at', 0)->nullable()->useCurrent()->comment('创建时间');
            $table->integer('update_admin_id')->default(0)->comment('更新者id');
            $table->timestamp('updated_at', 0)->nullable()->comment('更新时间');
            $table->integer('delete_admin_id')->default(0)->comment('删除者id');
            $table->softDeletes('deleted_at', 0)->nullable()->comment('软删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
